<template>
    <Div>
        <template>
            <el-table
                    :data="tableData.filter(data => !search || data.name.toLowerCase().includes(search.toLowerCase()))"
                    style="width: 100%" >
                <el-table-column
                        label="#"
                        prop="num">
                </el-table-column>
                <el-table-column
                        label="标签名"
                        prop="labeld">
                </el-table-column>



                <el-table-column     label="操作"  prop="model">

                    <template slot-scope="scope">

                        <el-button
                                size="mini"
                                @click="handleEdit(scope.$index, scope.row)">修改</el-button>
                        <el-button
                                size="mini"
                                type="danger"
                                @click="handleDelete(scope.$index, scope.row)">删除</el-button>
                    </template>
                </el-table-column>

            </el-table>
        </template>

    </Div>
</template>

<script>
    export default {
        name: "label",
        data() {
            return {
                tableData: [
                    {
                        num: '0',
                        labeld: '旅游',

                    },
                    {
                        num: '1',
                        labeld: '美食',

                    },
                ],
                search: ''
            }
        },
        methods: {
            handleEdit(index, row) {
                console.log(index, row);
            },
            handleDelete(index, row) {
                console.log(index, row);
            }
        },

    }
</script>

<style scoped>

</style>